﻿Public Class PowerShellCronContext
    Inherits DbContext

    Public Property Logs As DbSet(Of Log)
    Public Property Jobs As DbSet(Of Job)
    Public Property Categories As DbSet(Of Category)
    Public Property Tags As DbSet(Of Tag)
    Public Property JobHistories As DbSet(Of JobHistory)
    Public Property JobSteps As DbSet(Of JobStep)
    Public Property Scripts As DbSet(Of Script)
    Public Property ScriptHistories As DbSet(Of ScriptHistory)
    Public Property ScriptResults As DbSet(Of ScriptResult)
    Public Property SecurityUser As DbSet(Of SecurityUser)
    Public Property SecurityRole As DbSet(Of SecurityRole)
    Public Property SecurityRoleAccess As DbSet(Of SecurityRoleAccess)

    'Public Overrides Function SaveChanges() As Integer
    '   Return MyBase.SaveChanges()
    'End Function

    Public Sub SeedEnums()

    End Sub

    Protected Overrides Sub OnModelCreating(modelBuilder As DbModelBuilder)
        MyBase.OnModelCreating(modelBuilder)

        modelBuilder.Configurations.Add(New JobStep.JobStepConfiguration)
        modelBuilder.Configurations.Add(New ScriptHistory.ScriptHistoryConfiguration)
    End Sub
End Class